package com.mit.web.business.proxy
{
	import com.mit.web.business.remote.BaseService;
	import com.mit.web.business.remote.IInvokeResponder;
	import com.mit.web.config.Constants;
	import com.mit.web.vo.sys.UserVO;
	
	/**
	 * 提供Security模块的远程调用，使用getInstance()获取实例
	 * 
	 * */
	public class SecurityProxy extends BaseService
	{
		
		private static var me:SecurityProxy;
		
		//Flex 不能将构建函数声明为private
		public function SecurityProxy()
		{
			super(Constants.REMOTE_OBJECT_SECURITY);
			if(me != null)
				throw new Error("Only one instance of this class is allowed, use getInstance() insteadof the constructor.");
		}
		
		/**
		 * 通过该方法获取实例，不能使用构造函数。
		 * */
		public static function getInstance():SecurityProxy{
			if(me == null)
				me = new SecurityProxy();
			return me;
		} 
		
		/**
		 * 根据用户名密码读取账户资料
		 * */
		public function getUserAccount(username:String, password:String):IInvokeResponder{
			return invoke("retrieveUserByNamePwd", username, password);
		}
	}
}